package com.syp.hehe.domain;

public enum ArticleTypeEnum {

	PIC("pic", 1, "图片"), DUAN("duan", 2, "段子");

	private String type;
	private int code;
	private String desc;

	private ArticleTypeEnum(String type, int code, String desc) {
		this.type = type;
		this.code = code;
		this.desc = desc;
	}

	public String getType() {
		return type;
	}

	public int getCode() {
		return code;
	}

	public String getDesc() {
		return desc;
	}
	
	public static ArticleTypeEnum getEnum(String type){
		for(ArticleTypeEnum item : ArticleTypeEnum.values()){
			if(item.getType().equals(type)){
				return item;
			}
		}
		return null;
	}

}
